<template>
  <el-main>
    <hello-world>楼盘排名</hello-world>
    <!-- 列表 -->
    <el-table
        :data="tableData"
        style="width: 90%">
      <!-- 多选
      <el-table-column
      type="selection"
      ></el-table-column>-->

      <el-table-column width="100"
          label="#" prop="estateId"
      ></el-table-column>

      <el-table-column
          prop="estateName"
          label="estateName">
      </el-table-column>


      <el-table-column
          prop="estateLocation"
          label="estateLocation">
      </el-table-column>

      <el-table-column
          prop="bdnames"
          label="bdnames">
      </el-table-column>

      <el-table-column
           prop="slnames"
           label="slnames" width="200">
      </el-table-column>

      <el-table-column
             prop="rank"
             label="num">
      </el-table-column>

      <el-table-column
          prop="rank"
          label="rank">
        <template slot-scope="scope">
          {{scope.$index+1}}
        </template>
      </el-table-column>

    </el-table>

  </el-main>
</template>

<script>
export default {
  data(){
    return {
      //查询条件
      queryForm:{
        title:null,
        pageNum:1,
        pageSize:6
      },
      //列表数据
      tableData:[],
      //table选择数据Id数组
      selecteIds:[],
      //总页数
      pageCount:1
    }
  },
  methods:{
    gotoPage(current){
      this.queryForm.pageNum = current;
      this.list();
    },
    querySubmit(){
      //发送ajax请求，根据queryForm查询数据
      console.log(this.queryForm);
      if (this.queryForm.title == "") {
        this.queryForm.title = null;
      }
      this.queryForm.pageNum=1;
      this.list();

    },
    //列表页数据
    list(){
      this.axios.get("estate/rank",{params:this.queryForm}).then(res=>{
        this.tableData = res.data.data.list;
        this.pageCount = res.data.data.totalPages;
      })
    }
  },
  created(){
    this.list();
  }
}
</script >

<style scoped>

</style>
